import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'pos_link_method_channel.dart';

abstract class PosLinkPlatform extends PlatformInterface {
  /// Constructs a PosLinkPlatform.
  PosLinkPlatform() : super(token: _token);

  static final Object _token = Object();

  static PosLinkPlatform _instance = MethodChannelPosLink();

  /// The default instance of [PosLinkPlatform] to use.
  ///
  /// Defaults to [MethodChannelPosLink].
  static PosLinkPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [PosLinkPlatform] when
  /// they register themselves.
  static set instance(PosLinkPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  /*
   * 获取权限
   */
  Future<bool> permissionAllowed() async{
    return await _instance.permissionAllowed();
  }

  Future<void> configureFlutterEngine()async{
    _instance.configureFlutterEngine();
  }
}
